#ifndef DATABASECONTROLLER_H
#define DATABASECONTROLLER_H

#include<QObject>
#include<QPointer>
#include<QSet>

class Database;
class DatabaseView;
class Song;

class DatabaseController: public QObject{
Q_OBJECT
public:
	DatabaseController(QWidget *parent);
	~DatabaseController();
	
	QWidget *widget()const;
	
	void addSongToDB(QPointer<Song> song);
private slots:
	void slotPopulate();
	void slotPopulate(const QString &artist);
	void slotPopulate(const QString &artist, const QString &album);
	void slotDBContentsChanged(QSet<QString> changedArtists);
private:
	Database *m_database;
	DatabaseView *m_view;
	
	static void filesEdited(void *obj, QList<QString> filepaths);
	void filesEdited(QList<QString> filepaths);
};

#endif
